home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10316 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net   (Bill McCarthy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ***NEED HELP WITH CALCULATION FUNCTION*** ASAP
  5. Date: 16 Mar 1996 19:03:07 GMT
  6. Organization: Nando.net Public Access
  7. Message-ID: <4if39b$d2h@castle.nando.net>
  8. References: <4i0mva$j0c@fountain.mindlink.net>
  9. Reply-To: actuary@nando.net (Bill McCarthy)
  10. NNTP-Posting-Host: grail1814.nando.net
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4i0mva$j0c@fountain.mindlink.net>, mike_huwe@mindlink.bc.ca (Mike Huwe) writes:
  14. >I need to write a function called calc_investment() based on the following
  15. >formula: P = F/(1+r)^n
  16. >
  17. >where P : is the value to invest
  18. >      F : is the future amount needed
  19. >      r : is the annual rate of interest
  20. >      n : is the length of the period
  21. >      ^ : power of
  22. >
  23. >The user is allowed to enter the annual rate of interest either as a 
  24. >percentage eg. 15 or enter as a decimal eg. .15. If the user enters the
  25. >annual rate of interest as a percentage eg. 15, then divide by 100
  26. >before using it in the formula.
  27. >
  28. >Any ideas how I could code this test?
  29.  
  30. Your description doesn't make any sence.  One user may type 15
  31. meaning 15%, another might intend 1500%.  Likewise .15 may be
  32. a fractional representation of 15% of a percentage representation
  33. of 15 basis points.
  34.  
  35. BTW, does any of this have anything to do with C?
  36.  
  37. Bill McCarthy
  38. actuary@nando.net
  39. Wendell, NC  USA
  40.  
  41.